// pages/shop/shop.js
let app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    id: 0,
    shopInfo: {},
    goods: []
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let that = this
    app.request('api/shop/detile', {
      id: options.id
    }, function (res) {
      that.setData({
        shopInfo: res.shop,
        goods: res.goods
      });
    });
  },
  toGoodDetail(event){
    wx.navigateTo({
      url: '/pages/shop/detail?id=' + event.currentTarget.dataset.id,
    })
  }
})